home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / gnome-menus.preinst < prev    next >
Text File  |  2009-10-02  |  1KB  |  34 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. # Remove a no-longer used conffile
  5. rm_conffile() {
  6.     PKGNAME="$1"
  7.     CONFFILE="$2"
  8.     if [ -e "$CONFFILE" ]; then
  9.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  10.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
  11.         if [ "$md5sum" != "$old_md5sum" ]; then
  12.             echo "Obsolete conffile $CONFFILE has been modified by you."
  13.             echo "Saving as $CONFFILE.dpkg-bak ..."
  14.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  15.         else
  16.             echo "Removing obsolete conffile $CONFFILE ..."
  17.             rm -f "$CONFFILE"
  18.         fi
  19.     fi
  20. }
  21.  
  22. case "$1" in
  23. install|upgrade)
  24.     if dpkg --compare-versions "$2" le "2.22.2-4"; then
  25.         rm_conffile gnome-menus "/etc/xdg/menus/gnome-preferences.menu"
  26.     fi
  27.     if dpkg --compare-versions "$2" le "2.26.2-0ubuntu1"; then
  28.         rm_conffile gnome-menus "/etc/xdg/menus/gnome-applications.menu"
  29.         rm_conffile gnome-menus "/etc/xdg/menus/gnome-settings.menu"
  30.     fi
  31. esac
  32.  
  33.  
  34.